package day021.tcp.demo6;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class TcpServer {
    private static final Logger LOGGER = LoggerFactory.getLogger("TcpServer服务端");

    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(9090);
        LOGGER.trace("服务器已启动...");

        while (true) {
            Socket server = ss.accept();
            LOGGER.trace(server.getInetAddress().getHostName() + "成功连接");

            new Thread(new UploadTask(LOGGER, server)).start();
        }
    }
}
